package com.cskaoyan.controller.wxhome;

import com.cskaoyan.model.vo.BaseRespVo;
import com.cskaoyan.model.vo.wxhomeindex.WxHomeIndexVO;
import com.cskaoyan.service.wxhome.WxHomeIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @program: project-market
 * @description:
 * @author: Jesson Guo
 * @create: 2021-12-03 17:31
 **/
@RequestMapping("wx/home")
@RestController
public class WxHomeIndex {
    @Autowired
    WxHomeIndexService wxHomeIndexService;
    @GetMapping("index")
    public BaseRespVo wxHomeIndex(HttpServletRequest request){
    Integer id = (Integer) request.getSession().getAttribute("uid");
    Integer userId=id;
        WxHomeIndexVO homeIndexData = wxHomeIndexService.getHomeIndex(userId);
        return BaseRespVo.ok(homeIndexData);

    }
}
